<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
	    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
	    <title>Hello APP</title>
	    <link rel="stylesheet" type="text/css" href="../../../css/index.css" />
	</head>
	<style type="text/css">
		.warp{width: 100%;}
		.num-box{width: 100%;margin-bottom: 10px;padding: 20px 15px 30px 15px;background:url(../../../image/main3/main3_bg.png) no-repeat center #FF9502;background-size:cover;color: #ffffff;box-sizing: border-box;}
		.num-box .t1{font-size: 16px;}
		.num-box .num{font-size: 48px;margin-top: 14px;font-weight: bold;height: 60px;}

		.info-list{width: 100%;}
		.info-list .info-one{width: 100%;padding: 0 15px;box-sizing: border-box;align-items: center;background: #FFFFFF;height: 70px;}
		.info-list .info-one .l .t1{font-size: 15px;color: #333333;font-weight: 500;}
		.info-list .info-one .l .t2{font-size: 12px;color: #999999;padding-top: 8px;}
		.info-list .info-one .r .t3{font-size: 15px;color: #FF9502;text-align: right;font-weight: bold;}
		.info-list .info-one .r .t4{font-size: 12px;color: #999999;text-align: right;padding-top: 8px;color: #ffffff;}
		.info-list .info-one:last-child:before{display: none;}

		/*时间选择*/
		.date{width: 100%;padding: 0 15px 0 15px;box-sizing: border-box;}
		.date .sel-date{height: 40px;width: auto;line-height: 40px;font-size: 14px;display: inline-block;padding-right: 20px;
		background: url(../../../image/main3/store/down.png) no-repeat right 10px center;background-size: 6px 4px;}

	</style>
	<body>
		<div id="vue" class="warp">

			<div class="num-box">
				<div class="t1">今日入账金额</div>
				<div class="num" v-text="Pdata.today_money"></div>
			</div>

			<div class="date">
				<div id="selTime" class="sel-date" tapmode onclick="sel_time(this)"></div>
			</div>

			<div class="info-list" style="display:none;" :style="{ display:(Pdata ? '':'none')}">
				<div class="info-one flex border-bottom" v-for="(item,key) in Pdata.listData">
					<div class="l flex1">
						<div class="t1" v-text="item.note"></div>
						<div class="t2" v-text="item.addtime"></div>
					</div>
					<div class="r">
						<div class="t3"><i v-if="item.type == 'del'">-</i><i v-if="item.type == 'add'">+</i><i v-text="item.value"></i></div>
						<div class="t4">0</div>
					</div>
				</div>
			</div>

			<!--占位图-->
			<div class="nodata" style="display:none;" :style="{ display:(noData ? '':'none')}">
				<img src="../../../image/no_page/no_jilu.png" />
				<p>暂无记录</p>
			</div>

			<!-- 底部 -->
			<div class="bottom-box" :style="{ display:(loadingMsg ? '':'none')}">
				<div class="msgbox" v-html="loadingMsg" style="color:#999;"></div>
			</div>

		</div>
	</body>
</html>
<script type="text/javascript" src="../../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">
	define(function (require, exports, module) {

		var timeDate = lanYun.getStorage('newDate');
		var stype = pageParam.type;
		var ptime = '';
		var ztime = '';
        var url = {
            "store":{
                "show":'store/Tixian/ruzhanglog',
            },
            "company":{
                "show":'company/Tixian/ruzhanglog',
            },
        }

		setTime = function () {
			$("#selTime").text(timeDate.t4);
			ptime = timeDate.t3 + '-01';
			ztime = timeDate.t4;
		}

		_page.getData = function(loading) {
			lanYun.getVueData({url:url[stype].show,get:{page:lanYun.page,time:ptime},cache:0,loading:loading},function(ret) {
				//console.log(JSON.stringify(ret));
			});
		};

		lanYun.newVue('#vue',{},function() {
			setTime();
			_page.getData(2);
		});

		//滚动加载..
		new auiScroll({distance:200, listen:true},function(ret) {
			if($(window).scrollTop() < 2) ret.isToBottom = false;
			var d = ret.scrollTop / 208;
			if(!ret.isToBottom) return;
			_page.getData(0);
		});

		// 选择时间
		sel_time = function () {
			lanYun.actionSelect({
				col:2,
				cachekey:'time',
				title:'选择时间',
				successCall:function(result){
					if(result && result.eventType == 'ok' && result.selectedInfo){
						//ztime = result.level1 + result.level2 +  result.level3;
						ztime = result.level1 + result.level2;
						$('#selTime').text(ztime);
						var data = [];
						$.each(result.selectedInfo, function(k,v){
							//data.push(v.name0);
							if(k<2){
								data.push(v.name0);
							}
						});
						ptime = data.join("-");
						ptime = ptime + '-01';

						// 只刷新列表
						lanYun.ajaxPageSta = 0; lanYun.page = 1;
						_page.getData(2);
					}
				}
			});
		}

	});
</script>
